<?php
/**
 * 发仔 <i@fazi.me>
 */
namespace app\open\model;

use think\model;
use traits\model\SoftDelete;
class Order extends model
{
    use SoftDelete;
    protected $deleteTime = 'delete_time';
    protected $autoWriteTimestamp = true;

    //司机
    public function driver() {
        return $this->hasOne('Driver','driver_id','driver_id','','left')->setEagerlyType(0);
    }
    //区域
    public function area() {
        return $this->hasOne('Area','area_id','area_id','','left')->setEagerlyType(0);
    }
    //车辆
    public function car() {
        return $this->hasOne('Car','car_id','car_id','','left')->setEagerlyType(0);
    }
    //所属公司
    public function company() {
        return $this->hasOne('Company','company_id','company_id','','left')->setEagerlyType(0);
    }
    //费用
    public function fee() {
        return $this->hasOne('OrderFee','order_id','order_id','','left')->setEagerlyType(0);
    }
    //GPS
    public function gps() {
        return $this->hasOne('OrderGps','order_id','order_id','','left')->setEagerlyType(0);
    }
}